/**
 *	 插件类，包括传递参数、跳转进入变电站页面、清除缓存数据、进入百度离线导航页面、手持RFID蓝牙设备扫描射频标签
 *	 @author xuhaifeng
 */
cordova.define("com.frontier.ptmo.plugins.deliver.DeliverPlugin", function(require, exports, module) {/**
 * cordova is available under *either* the terms of the modified BSD license *or* the
 * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
 *
 * Copyright (c) Matt Kane 2010
 * Copyright (c) 2011, IBM Corporation
 */


        var exec = require("cordova/exec");

        var deliver={
//      	//传递参数的插件
        	getParam: function(success, failure, number){
		
			/**
			 *  成功回调
			 *  失败回调
			 *  将要调用的类的配置名字(在config.xml中配置)
			 *  调用的方法名(一个类里可能有多个方法 靠这个参数区分)
			 *  传递的参数 以json格式:[{}]
			*/
			exec(success, failure, "Deliver", "getParam", number);
		    },
		    //进入变电站页面
			gotoSubLocate:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "gotoSubLocate", number);
			},
			//清除缓存数据
			cleanCacheData:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "cleanCache", number);
			},
			//进入离线导航页面
			gotoBaiduNavi:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "gotoBaiduNavi", number);
			},
			//rfid
			bluetoothScan:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "bluetoothScan", number);
			},
			//获取经纬度信息
			getGpsLoc:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "getGpsLoc", number);
			},
			//解压缩
			unZip:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "unZip", number);
			},
			//获取两个经纬度之间的距离：参数顺序：//目标经度//目标纬度//原始经度//原始纬度
			getDistance:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "getDistance", number);
			},
			isInstallApp:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "isInstallApp", number);
			},
            //进入蓝牙下发  参数顺序:检测主机名称，json业务数据
            gotoBltTask:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "gotoBltTask", number);
            },
            //获取应用版本信息
            getAppInfo:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "getAppInfo", number);
            },
			//获取应用包名信息
            getAppPackage:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "getAppPackage", number);
            },
			//打开应用
            openAppPackage:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "openAppPackage", number);
            },//进入登录界面
			gotoLoginPage:function(success,failure,number)
			{
				exec(success, failure, "Deliver", "gotoLoginPage", number);
			},
			//打开文件
            openFile:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "openFile", number);
            },
            //获取GPS （经度 纬度 速度）
            speedGps:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "speedGps", number);
            },
            //进入二次检修
            gotoEcjx:function(success,failure,number)
            {
                exec(success, failure, "Deliver", "gotoEcjx", number);
            },
            deletEcfile:function(success,failure,number)
           {
               console.log('222222222222222222222222222')
               exec(success, failure, "Deliver", "deletEcfile", number);
           },

            //进入原五通界面
            gotoHome:function(success,failure,number)
            {
                console.log('调用主界面')
                exec(success, failure, "Deliver", "gotoHome", number);
            },

        };
        module.exports = deliver;

});
